<?php


namespace app\crm\validate;


use think\Validate;

/**
 * Class Article
 * @package app\admin\validate
 */
class BalanceLog extends Validate
{

    /**
     * 验证规则
     * @var string[]
     */
    protected $rule = [
        'customer_id'              => 'require|number|gt:0',
        'balance_category_id'      => 'require|number|gt:0',
        'mode_money'               => 'require',
        'mode_complimentary_money' => 'require',
        'mode_net_receipts'        => 'require',
        'transaction_method'       => 'require|number|gt:0',
        'drawer_id'                => 'require|number|gt:0'
    ];

    /**
     * 错误信息
     * @var string[]
     */
    protected $message = [
        'customer_id.require'              => '请填写客户',
        'customer_id.number'               => '请填写客户',
        'customer_id.gt'                   => '请填写客户',
        'balance_category_id.require'      => '请选择余额类型',
        'balance_category_id.number'       => '请选择余额类型',
        'balance_category_id.gt'           => '请选择余额类型',
        'mode.require'                     => '请选择变更方式',
        'mode.number'                      => '请选择变更方式',
        'mode.gt'                          => '请选择变更方式',
        'mode_money.require'               => '请填写变更的余额',
        'mode_complimentary_money.require' => '请填写变更的增金金额',
        'mode_net_receipts.require'        => '请填写实际收款金额',
        'transaction_method.require'       => '请选择成交方式',
        'transaction_method.number'        => '请选择成交方式',
        'transaction_method.gt'            => '请选择成交方式',
        'drawer_id.require'                => '请填写开单人',
        'drawer_id.number'                 => '请填写开单人',
        'drawer_id.gt'                     => '请填写开单人',
    ];

    /**
     * 验证场景
     * @var string[]
     */
    protected $scene = [
        'create' => ['customer_id', 'balance_category_id', 'mode', 'mode_money', 'mode_complimentary_money', 'mode_net_receipts', 'transaction_method', 'drawer_id']
    ];

}